package com.ef.web.action;

import java.io.File;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.RequestDispatcher;
import javax.servlet.http.HttpServletRequest;

import jxl.Workbook;
import jxl.write.Label;
import jxl.write.WritableSheet;
import jxl.write.WritableWorkbook;
import jxl.write.WriteException;

import org.apache.struts2.ServletActionContext;

import com.ef.constant.EClassEntityType;
import com.ef.constant.EClassType;
import com.ef.constant.ELeadsClassStatus;
import com.ef.constant.ETimeline;
import com.ef.constant.SystemContant;
import com.ef.domain.ClassEntity;
import com.ef.domain.Leads;
import com.ef.domain.LeadsClassEntity;
import com.ef.domain.Teacher;
import com.ef.service.ClassArrangeService;
import com.ef.service.ClassBookingService;
import com.ef.service.LeadsClassEntityService;
import com.ef.service.LeadsService;
import com.ef.service.TeacherService;
import com.ef.util.CalendarUtil;

/**
 * 课程预订相关操作 .<br/>
 * 流程: CR 根据条件先选到相关学生,然后为学生预订相关课程.<br/>
 * 
 * @author CYG create:2009-12-12 上午09:47:20
 */
public class ClassBookingAction extends BaseAction<LeadsClassEntity> {

	private static final long serialVersionUID = 6471086700301676748L;

	private ClassBookingService classBookingService;

	private ClassArrangeService classArrangeService;

	private LeadsClassEntityService leadsClassEntityService;

	private TeacherService teacherService;

	private LeadsService leadsService;

	private int year;
	// 显示的周数
	private int week;
	/**
	 * 一周七天
	 */
	private List<Date> days;

	/**
	 * 老师,横轴
	 */
	private List<Teacher> teachers;

	private Map<String, String> checkMessageMap = new LinkedHashMap<String, String>();

	private String selTime;

	private Date selDate;
	/**
	 * 选到的classEntity
	 */
	private Long selClassEntityId;

	private Long selLeadsId;

	private Leads selLeads;

	private Boolean isWaiting = true;

	/**
	 * 时间轴
	 */
	private List<ETimeline> normalTimeline;
	/**
	 * 时间轴
	 */
	private List<ETimeline> weekendTimeline;

	public ClassBookingAction() {
		// 获取当前是某年某周
		// @NOTE 需要对year进行处理
		Calendar now = Calendar.getInstance();
		now.setFirstDayOfWeek(Calendar.MONDAY);
		int day = now.get(Calendar.DAY_OF_YEAR);
		week = now.get(Calendar.WEEK_OF_YEAR);
		year = now.get(Calendar.YEAR);
		if (day > 7 && week == 1) {
			year++;
		}
		// //NOTE week要-1
		if (year == 2010) {
			week = week - 1;
		}

		selDate = new Date();
		normalTimeline = ETimeline.getNomarlTimeline();
		weekendTimeline = ETimeline.getWeekendTimeline();
	}

	public List<ETimeline> getTimeline(Date date) {
		if (CalendarUtil.isWeekend(date)) {
			return weekendTimeline;
		} else {
			return normalTimeline;
		}
	}

	private List<ClassEntity> allClassEntity;

	/**
	 * 获取订课的学生课程
	 * 
	 * @return
	 */
	public String list() {
		fetchListData();
		if (selClassEntityId != null) {
			this.listResult = leadsClassEntityService.findByClassEntityId(
					selClassEntityId, isWaiting, this.getStartIndex(), 60);
			return LIST;
		}
		if (selDate != null && selTime != null && selTime.trim().length() > 0) {
			this.listResult = leadsClassEntityService.findByDateTime(selDate,
					ETimeline.valueOf(selTime.trim()), isWaiting, this
							.getStartIndex(), 60);
			return LIST;
		}
		if (selDate != null) {
			this.listResult = leadsClassEntityService.findByDate(selDate,
					isWaiting, this.getStartIndex(), 60);
			return LIST;
		}
		return LIST;
	}

	public String listLeadsClassEntity() {
		if (selLeadsId != null) {
			int trueWeek = week;
			if (year == 2010) {
				trueWeek = trueWeek + 1;
			}
			selLeads = leadsService.findById(selLeadsId);
			Date md = CalendarUtil.getBeginOfDay(CalendarUtil
					.getMondayOfWeekWithMonDayIsFirstDay(year, trueWeek));
			Date sd = CalendarUtil.getEndOfDay(CalendarUtil
					.getSundayOfWeekWithMonDayIsFirstDay(year, trueWeek));
			this.listResult = leadsClassEntityService.findByLeadIdBetweenDays(
					selLeadsId, md, sd, this.getStartIndex(), 60);
			return LIST;
		}
		return LIST;
	}

	protected void fetchListData() {
		// System.out.println(this.selTime);
		if (selTime != null && selTime.trim().length() > 0) {
			allClassEntity = classArrangeService.getClassEntityByDateTime(
					selDate, ETimeline.valueOf(selTime.trim()));
		} else {
			allClassEntity = new ArrayList<ClassEntity>();
		}
		List<ETimeline> times = null;
		if (CalendarUtil.isWeekend(selDate)) {
			times = ETimeline.getWeekendTimeline();
		} else {
			times = ETimeline.getNomarlTimeline();
		}
		for (ETimeline timeline : times) {
			String msg = classArrangeService.getClassCheckMessage(selDate,
					timeline);
			checkMessageMap.put(timeline.name(), timeline.toString() + "    "
					+ msg);
		}
	}

	public Boolean isManager() {
		if (getSessionUser().getRole().getName().equalsIgnoreCase("CR")) {
			return false;
		} else {
			return true;
		}
	}

	private HashMap<Long, HashMap<String, ClassEntity>> teacherClassMaps = null;

	private List<LeadsClassEntity> leadsSelectedClasslist = null;

	public String beforeBooking() {
		teachers = teacherService.getAllValidTeachers();
		if (selLeadsId != null) {
			selLeads = leadsService.findById(selLeadsId);
		}
		int trueWeek = week;
		if (year == 2010) {
			trueWeek = trueWeek + 1;
		}
		days = CalendarUtil.getWeekTimelineDaysWithMonDayIsFirstDay(year,
				trueWeek);
		teacherClassMaps = classArrangeService.getClassEntityMapInTime(
				CalendarUtil
						.getMondayOfWeekWithMonDayIsFirstDay(year, trueWeek),
				CalendarUtil
						.getSundayOfWeekWithMonDayIsFirstDay(year, trueWeek));
		if (selLeadsId != null) {
			leadsSelectedClasslist = leadsClassEntityService
					.getLeadsClassEntityListOrderByBookingTime(year, trueWeek,
							selLeads);
		}
		return "beforeBooking";
	}

 	public String getClassEntityInfo(Date date, ETimeline timeline,
			String teacherid) {
		HashMap<String, ClassEntity> cMap = teacherClassMaps.get(Long
				.valueOf(teacherid));
		if (cMap == null) {
			return "";
		} else {
			ClassEntity entity = cMap.get(sd.format(date) + timeline.getName());
			if (entity != null) {
				String msg = entity.getBookingMessage();
				if (msg.length() > 14) {
					msg = msg.substring(0, 14);
				}
				return msg;
			} else {
				return "";
			}
		}
	}

	private SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd");

	public String getBookingOrCancel(Date date, ETimeline timeline,
			String teacherid) {
		HashMap<String, ClassEntity> cMap = teacherClassMaps.get(Long
				.valueOf(teacherid));
		if (cMap == null) {
			return "NO";
		} else {
			ClassEntity entity = cMap.get(sd.format(date) + timeline.getName());
			if (entity != null) {
				return getBookingAction(entity);
			} else {
				return "NO";
			}
		}
	}

	public String getClassEntityColor(Date date, ETimeline timeline,
			String teacherid) {
		SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd");
		HashMap<String, ClassEntity> cMap = teacherClassMaps.get(Long
				.valueOf(teacherid));
		if (cMap == null) {
			return "";
		} else {
			ClassEntity entity = cMap.get(sd.format(date) + timeline.getName());
			if (entity != null) {
				return getStatusColor(entity);
			} else {
				return "";
			}
		}
	}

	public String getClassEntityToolTip(Date date, ETimeline timeline,
			String teacherid) {
		SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd");
		HashMap<String, ClassEntity> cMap = teacherClassMaps.get(Long
				.valueOf(teacherid));
		if (cMap == null) {
			return "";
		} else {
			ClassEntity entity = cMap.get(sd.format(date) + timeline.getName());
			if (entity != null) {
				return entity.getToolTip();
			} else {
				return "";
			}
		}
	}

	/**
	 * 获取当前选课情况的状态.<br/>
	 * 
	 * @return 返回显示颜色参数
	 */
	public String getStatusColor(ClassEntity entity) {
		LeadsClassEntity selectClass = null;
		for (LeadsClassEntity lClass : leadsSelectedClasslist) {
			if (lClass.getClassEntity().getId().equals(entity.getId())) {
				selectClass = lClass;
				break;
			}
		}
		if (selectClass != null
				&& !selectClass.getClassStatus()
						.equals(ELeadsClassStatus.CLEAR)) {
			if (selectClass.getClassStatus().equals(ELeadsClassStatus.BOOKING)) {
				return SystemContant.BOOKING_SELECTED_COLOR;
			}
			if (selectClass.getClassStatus().equals(ELeadsClassStatus.WAITING)) {
				return SystemContant.BOOKING_WAIT_COLOR;
			}
			if (selectClass.getClassStatus().equals(ELeadsClassStatus.CHECKIN)) {
				return SystemContant.BOOKING_CHECKIN_COLOR;
			}
			if (selectClass.getClassStatus().equals(ELeadsClassStatus.ABSENCE)) {
				return SystemContant.BOOKING_ABSENCE_COLOR;
			}
			if (selectClass.getClassStatus().equals(ELeadsClassStatus.CANCEL)) {
				return SystemContant.BOOKING_PUNISH_COLOR;
			} else {
				return SystemContant.BOOKING_NORMAL;
			}
		} else {
			if (entity.isF2F()) {
				if (entity.isFull()) {
					return SystemContant.BOOKING_F2FFULL_COLOR;
				}
				if (entity.getAllStudent() == 0
						&& !entity.getTeacher().isForeign()) {
					return SystemContant.BOOKING_F2FCHINESE_COLOR;
				}
				if (entity.getType().equals(EClassEntityType.FREEF2F)) {
					return SystemContant.BOOKING_F2FFREE_COLOR;
				}
				if (entity.getAllStudent() == 0) {
					return SystemContant.BOOKING_F2FALL_COLOR;
				}
				if (entity.getClassLevel() != null
						&& selLeads.getCurrentlevel() != null) {
					if (entity.getClassLevel().getCategory().equals(
							selLeads.getCurrentlevel().getCategory())) {
						return SystemContant.BOOKING_F2FMATCH_COLOR;
					} else {
						return SystemContant.BOOKING_F2FUNMATCH_COLOR;
					}
				}
			}
			if (entity.isFull()) {
				return SystemContant.BOOKING_FULL_COLOR;
			}
		}
		return SystemContant.BOOKING_NORMAL;
	}

	public String getBookingAction(ClassEntity entity) {
		LeadsClassEntity selectClass = null;
		for (LeadsClassEntity lClass : leadsSelectedClasslist) {
			if (lClass.getClassEntity().getId().equals(entity.getId())) {
				selectClass = lClass;
				break;
			}
		}
		if (selectClass != null) {
			if (selectClass.getClassStatus().equals(ELeadsClassStatus.BOOKING)) {
				return "CANCEL";
			}
			if (selectClass.getClassStatus().equals(ELeadsClassStatus.WAITING)) {
				return "NO";
			}
			if (selectClass.getClassStatus().equals(ELeadsClassStatus.CHECKIN)) {
				return "NO";
			}
			if (selectClass.getClassStatus().equals(ELeadsClassStatus.ABSENCE)) {
				return "NO";
			}
			return "BOOKING";
		} else {
			return "BOOKING";
		}
	}

	public String getClassEntityId(Date date, ETimeline timeline,
			String teacherid) {
		SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd");
		HashMap<String, ClassEntity> cMap = teacherClassMaps.get(Long
				.valueOf(teacherid));
		if (cMap == null) {
			return "-1";
		} else {
			ClassEntity entity = cMap.get(sd.format(date) + timeline.getName());
			if (entity != null) {
				return entity.getId().toString();
			} else {
				return "-1";
			}
		}
	}

	/**
	 * 使用AJAX进行课程预订。<br/>
	 * 目前 type:有 BOOKING(一般课程预订),PSA(PSA课程预订),VIP（VIP)课程预定,CANCEL(取消) <br/>
	 * confirm: 需要进行 确认的情况 ,用1 开始的顺序数字表示，逐步进行判断。
	 * 
	 * @return
	 */
	public String doBooking() {
		String responseStr = "";
		if (this.getSessionUser() == null) {
			responseStr = "<type>error</type>"
					+ "<info>plesas login in first</info>";
			return response(responseStr);
		}
		HttpServletRequest request = ServletActionContext.getRequest();
		String type = request.getParameter("type");
		EClassEntityType bookType = EClassEntityType.valueOf(type);
		String confirm = request.getParameter("confirm");
		String bookingComments = request.getParameter("bookingComments");
		String bookingOrder = request.getParameter("bookingOrder");
		String judge = "";
		int trueWeek = week;
		if (year == 2010) {
			trueWeek = trueWeek + 1;
		}
		try {
			judge = this.classBookingService.isCanDoBooking(bookType, Long
					.valueOf(selClassEntityId), Long.valueOf(selLeadsId), year,
					trueWeek, confirm, bookingOrder, bookingComments);
		} catch (Exception e) {
			return responseError("judge can booking error:" + e.getMessage());
		}
		if (judge == null) {// 确定可以进行booking
			if (bookType.equals(EClassEntityType.CANCEL)) {
				responseStr = classBookingService.doCancel(Long
						.valueOf(selClassEntityId), Long.valueOf(selLeadsId),
						this.getSessionUser());
			} else {
				responseStr = classBookingService.doBooking(Long
						.valueOf(selClassEntityId), Long.valueOf(selLeadsId),
						EClassEntityType.valueOf(type), this.getSessionUser(),
						bookingOrder, bookingComments);
			}
		} else if (judge.startsWith("WARNING")) {// 需要再次确认
			int I = judge.indexOf("!");
			String info = judge.substring(0, I + 1);
			String confirmM = judge.substring(I + 1).trim();
			responseStr = "<type>warn</type>" + "<info>" + info
					+ "</info><confirm>" + confirmM + "</confirm><dotype>"
					+ type + "</dotype>";
		} else if (judge.startsWith("ERROR")) {
			responseStr = "<type>error</type>" + "<info>" + judge + "</info>";
		}
		return response(responseStr);
	}

	/**
	 * 数据导出的日期
	 */
	private Date exportDate;

	public String changeBookingStatus() {
		String responseStr = "";
		if (this.getSessionUser() == null) {
			responseStr = "<type>error</type>"
					+ "<info>plesas login in first!</info>";
			return response(responseStr);
		}
		HttpServletRequest request = ServletActionContext.getRequest();
		String type = request.getParameter("type");
		EClassEntityType bookType = EClassEntityType.valueOf(type);
		String confirm = request.getParameter("confirm");
		String judge = "";
		Date date = this.getModel().getClassEntity().getClassDate();
		// CYG 100306 特别情况 ，ABSENCE 允许 Cancel
		if (this.getModel().getClassStatus().equals(ELeadsClassStatus.ABSENCE)
				&& bookType.equals(EClassEntityType.CANCEL)) {
			responseStr = classBookingService.changeAbsenceToCancel(getModel()
					.getId(), this.getSessionUser());
			return response(responseStr);
		}
		;
		// 其他情况
		year = CalendarUtil.getYearWithMondayIsFirstDay(date);
		week = CalendarUtil.getWeekOfYearWithMondayIsFirstDay(date);
		selClassEntityId = this.getModel().getClassEntity().getId();
		selLeadsId = this.getModel().getLeads().getId();
		try {
			if (bookType.equals(EClassEntityType.CANCEL)) {// 取消订课
				judge = classBookingService.isCanCancel(selClassEntityId,
						selLeadsId, year, week, confirm);
			} else {
				judge = this.classBookingService.isCanChangeStatusToBooking(
						this.getModel().getId(), confirm);
			}
		} catch (Exception e) {
			return responseError("judge can booking error:" + e.getMessage());
		}
		;
		if (judge == null) {// 确定可以进行booking
			if (bookType.equals(EClassEntityType.CANCEL)) {
				responseStr = classBookingService.doCancel(selClassEntityId,
						selLeadsId, this.getSessionUser());
			} else {
				responseStr = classBookingService.changeWaitingToBooking(
						getModel().getId(), EClassEntityType.valueOf(type),
						this.getSessionUser());
			}
		} else if (judge.startsWith("WARNING")) {// 需要再次确认
			int I = judge.indexOf("!");
			String info = judge.substring(0, I + 1);
			String confirmM = judge.substring(I + 1).trim();
			responseStr = "<type>warn</type>" + "<info>" + info
					+ "</info><confirm>" + confirmM + "</confirm><dotype>"
					+ type + "</dotype>";
		} else if (judge.startsWith("ERROR")) {
			responseStr = "<type>error</type>" + "<info>" + judge + "</info>";
		}
		return response(responseStr);
	}

	public String export() {
		exportDate = new Date();
		classEntityTypes = EClassEntityType.getClassEntityType();
		return "export";
	}

	private List<EClassEntityType> classEntityTypes;

	private String selClassEntityTypes;
	private String selClassTypes;

	public String getSelClassEntityTypes() {
		return selClassEntityTypes;
	}

	public void setSelClassEntityTypes(String selClassEntityTypes) {
		this.selClassEntityTypes = selClassEntityTypes;
	}

	public String getSelClassTypes() {
		return selClassTypes;
	}

	public void setSelClassTypes(String selClassTypes) {
		this.selClassTypes = selClassTypes;
	}

	public String doExport() {
		SimpleDateFormat f = new SimpleDateFormat("yyMMdd");
		if (exportDate == null) {
			exportDate = new Date();
		}
		String filename = f.format(exportDate);
		ArrayList<EClassEntityType> eTypes = null;
		if (selClassEntityTypes != null
				&& selClassEntityTypes.trim().length() > 0) {
			filename = filename + "[" + selClassEntityTypes.trim() + "]";
			filename = filename.replaceAll(",", "_");
			filename = filename.replaceAll(" ", "");
			String[] ces = selClassEntityTypes.trim().split(",");
			eTypes = new ArrayList<EClassEntityType>();
			for (String ce : ces) {
				eTypes.add(EClassEntityType.valueOf(ce.trim()));
			}
		}
		ArrayList<EClassType> cTypes = null;
		if (selClassTypes != null && selClassTypes.trim().length() > 0) {
			filename = filename + "[" + selClassTypes.trim() + "]";
			filename = filename.replaceAll(",", "_");
			filename = filename.replaceAll(" ", "");
			String[] cs = selClassTypes.trim().split(",");
			cTypes = new ArrayList<EClassType>();
			for (String c : cs) {
				cTypes.add(EClassType.valueOf(c.trim()));
			}
		}
		filename = filename + ".xls";
		// HttpServletResponse response = getResponse();
		getResponse().setContentType("application/ms-excel;charset=UTF-8");
		getResponse().setHeader("Content-Disposition",
				"attachment;filename=" + filename);
		List<ClassEntity> classes = null;
		if (eTypes != null && eTypes.size() > 0) {
			classes = classArrangeService.getClassEntityListByClassEntityType(
					exportDate, eTypes);
		} else if (cTypes != null && cTypes.size() > 0) {
			classes = classArrangeService.getClassEntityListByClassType(
					exportDate, cTypes);
		} else {
			classes = classArrangeService.getClassEntityList(exportDate);
		}
		File tempPath = new File(ServletActionContext.getServletContext()
				.getRealPath("/temp/classBooking"));
		if (!tempPath.exists()) {
			tempPath.mkdirs();
		}
		WritableWorkbook workBook;

		File exportFile = new File(ServletActionContext.getServletContext()
				.getRealPath("/temp/classBooking/" + filename));
		try {
			workBook = Workbook.createWorkbook(exportFile);
			workBook.setProtected(false);
			String sheetName = "sheet1";
			WritableSheet activeSheet = workBook.createSheet(sheetName, 0);
			int curX = 0;
			int curY = 0;
			int count = 1;
			int col = 0;
			int row = 0;
			int maxC = 0;
			// System.out.print("classes:"+classes.size());
			for (ClassEntity clz : classes) {
				if (col != 0 && col % 4 == 0) { // 四个课换行
					curX = 0;
					row = row + maxC + 5;
					curY = row;
					maxC = 0;
				} else {
					if (col != 0) {
						curX = curX + 5;
						curY = row;
					}
				}
				String foucs = "";
				if (clz.getType() != null
						&& !clz.getType().equals(EClassEntityType.NORMAL)) {
					foucs = clz.getClassFocus().getName() + "[" + clz.getType()
							+ "]";
				} else {
					foucs = clz.getClassFocus().getName();
				}
				activeSheet.addCell(new Label(curX + 1, curY++, clz
						.getClassTime().toString()));
				activeSheet.addCell(new Label(curX + 1, curY++, foucs));
				if (clz.getClassType() != null
						&& clz.getClassType().getType().equals(
								EClassType.INTERVIEW)) {
					activeSheet.addCell(new Label(curX + 1, curY++, clz
							.getTeacher().getName()
							+ "@" + clz.getClassroom().getName()));
				} else {
					activeSheet.addCell(new Label(curX + 1, curY++, clz
							.getClassroom().getName()));
				}
				// activeSheet.addCell(new Label(curX + 1, curY++, clz
				// .getTeacher().getName()));
				List<LeadsClassEntity> lCs = leadsClassEntityService
						.getLeadsClassEntityListWithClassEntityOrderByElitCard(clz);
				count = 1;
				for (LeadsClassEntity lC : lCs) {
					String lCinfo = "";
					String name = lC.getLeads().getName();
					String levelinfo = "";
					if (lC.getClassStatus().equals(ELeadsClassStatus.BOOKING)) {
						if (lC.getLeads().getEliteCard() != null
								&& lC.getLeads().getEliteCard().trim().length() > 0) {
							lCinfo = lC.getLeads().getEliteCard();
						}
						if (clz.getClassType().getType().equals(EClassType.F2F)) {
							if (lC.getLeads().getCurrentlevel() != null) {
								levelinfo = lC.getLeads().getCurrentlevel()
										.toString();
							}
						}
						if (clz.getType().equals(EClassEntityType.PSA)
								|| clz.getClassType().getType().equals(
										EClassType.INTERVIEW)) {
							name = name + "(" + lC.getClassOrder() + ")";
						}
					} else {
						continue;
					}
					activeSheet.addCell(new Label(curX, curY, String
							.valueOf(count++)));
					activeSheet.addCell(new Label(curX + 1, curY, String
							.valueOf(lCinfo)));
					activeSheet.addCell(new Label(curX + 2, curY, String
							.valueOf(levelinfo)));
					activeSheet.addCell(new Label(curX + 3, curY++, String
							.valueOf(name)));
				}// end LeadsClass
				if (count > maxC) {
					maxC = count;
				}
				col++;
			}
			workBook.write();
			workBook.close();

		} catch (IOException e) {
			e.printStackTrace();
		} catch (WriteException e) {
			e.printStackTrace();
		}

		RequestDispatcher view = getRequest().getRequestDispatcher(
				"../../temp/classBooking/" + filename);
		try {

			view.forward(getRequest(), getResponse());
		} catch (Exception e) {
		}
		return NONE;
	}

	public TeacherService getTeacherService() {
		return teacherService;
	}

	public void setTeacherService(TeacherService teacherService) {
		this.teacherService = teacherService;
	}

	public void setClassBookingService(ClassBookingService classBookingService) {
		this.classBookingService = classBookingService;
	}

	public ClassBookingService getClassBookingService() {
		return classBookingService;
	}

	public int getYear() {
		return year;
	}

	public void setYear(int year) {
		this.year = year;
	}

	public int getWeek() {
		return week;
	}

	public void setWeek(int week) {
		this.week = week;
	}

	public List<Date> getDays() {
		return days;
	}

	public void setDays(List<Date> days) {
		this.days = days;
	}

	public LeadsService getLeadsService() {
		return leadsService;
	}

	public void setLeadsService(LeadsService leadsService) {
		this.leadsService = leadsService;
	}

	public List<Teacher> getTeachers() {
		return teachers;
	}

	public void setTeachers(List<Teacher> teachers) {
		this.teachers = teachers;
	}

	public Long getSelLeadsId() {
		return selLeadsId;
	}

	public void setSelLeadsId(Long selLeadsId) {
		this.selLeadsId = selLeadsId;
	}

	public LeadsClassEntityService getLeadsClassEntityService() {
		return leadsClassEntityService;
	}

	public void setLeadsClassEntityService(
			LeadsClassEntityService leadsClassEntityService) {
		this.leadsClassEntityService = leadsClassEntityService;
	}

	public Map<String, String> getCheckMessageMap() {
		return checkMessageMap;
	}

	public void setCheckMessageMap(Map<String, String> checkMessageMap) {
		this.checkMessageMap = checkMessageMap;
	}

	public ClassArrangeService getClassArrangeService() {
		return classArrangeService;
	}

	public void setClassArrangeService(ClassArrangeService classArrangeService) {
		this.classArrangeService = classArrangeService;
	}

	public Date getSelDate() {
		return selDate;
	}

	public void setSelDate(Date selDate) {
		this.selDate = selDate;
	}

	public Long getSelClassEntityId() {
		return selClassEntityId;
	}

	public void setSelClassEntityId(Long selClassEntityId) {
		this.selClassEntityId = selClassEntityId;
	}

	public String getSelTime() {
		return selTime;
	}

	public void setSelTime(String selTime) {
		this.selTime = selTime;
	}

	public List<ClassEntity> getAllClassEntity() {
		return allClassEntity;
	}

	public void setAllClassEntity(List<ClassEntity> allClassEntity) {
		this.allClassEntity = allClassEntity;
	}

	public Leads getSelLeads() {
		return selLeads;
	}

	public void setSelLeads(Leads selLeads) {
		this.selLeads = selLeads;
	}

	public Boolean getIsWaiting() {
		return isWaiting;
	}

	public void setIsWaiting(Boolean isWaiting) {
		this.isWaiting = isWaiting;
	}

	public List<ETimeline> getNormalTimeline() {
		return normalTimeline;
	}

	public void setNormalTimeline(List<ETimeline> normalTimeline) {
		this.normalTimeline = normalTimeline;
	}

	public List<ETimeline> getWeekendTimeline() {
		return weekendTimeline;
	}

	public void setWeekendTimeline(List<ETimeline> weekendTimeline) {
		this.weekendTimeline = weekendTimeline;
	}

	public Date getExportDate() {
		return exportDate;
	}

	public void setExportDate(Date exportDate) {
		this.exportDate = exportDate;
	}

	public List<EClassEntityType> getClassEntityTypes() {
		return classEntityTypes;
	}

	public void setClassEntityTypes(List<EClassEntityType> classEntityTypes) {
		this.classEntityTypes = classEntityTypes;
	}

}
